package edu.avans.hartigehap.domain.decorator;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;

import edu.avans.hartigehap.domain.Restaurant;

@Entity
@Table(name = "TESTINGREDIENTS")
@JsonIdentityInfo(generator = ObjectIdGenerators.IntSequenceGenerator.class, property = "@id")
public class TestIngredient implements Serializable
{
	private static final long serialVersionUID = 1L;
	private int price;
	private String name;
	
	private Collection<Restaurant> restaurants = new ArrayList<Restaurant>();
	
	public TestIngredient()
	{
		
		
	}
	
	public TestIngredient(String name, int price)
	{
		this.name = name;
		this.price = price;
	}
	
	@Id
	//@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "INGREDIENT_ID")
    public String getId() {
		return name;
	}

	public void setId(String name) {
		this.name = name;
	}

	public int getPrice() 
	{
		return price;
    }
    
    public void setPrice(int price) {
		this.price = price;
	}

	@ManyToMany(cascade = javax.persistence.CascadeType.ALL)
	public Collection<Restaurant> getRestaurants() {
		return restaurants;
	}

	public void setRestaurants(Collection<Restaurant> restaurants) {
		this.restaurants = restaurants;
	}
}
